package com.hl.card.modular.packBack.controller;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import com.alibaba.fastjson.JSONObject;
import com.hl.card.common.controller.BaseController;
import com.hl.card.common.util.CommonUtil;
import com.hl.card.common.util.HttpClient;
import com.hl.card.common.util.PageData;
import com.hl.card.common.util.ResponseData;
import com.hl.card.modular.packBack.service.IntegralManageService;
import com.hl.card.modular.packBack.service.PassCardManagerService;

import org.apache.commons.collections.map.HashedMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 通证卡片管理
 * 
 * @author ldy
 */
@Controller
@RequestMapping("/passCardManager")
public class PassCardManagerController extends BaseController {
	
	private static final Logger logger = LoggerFactory.getLogger(PassCardManagerController.class);
	
	@Autowired
	private PassCardManagerService passCardManagerService;
	
	@Autowired
	private ResponseData responseData;
	
	private String PREFIX = "/dist/passCardManager/";
	
	/**
     *   比豆流水明细主页
     */
    @RequestMapping("")
    public String index(){
        return PREFIX+"passCardManager.html";
    }
    
	/**
	 * 分页查询
	 * @param pd
	 * @return
	 */
	@RequestMapping("/queryCardManager")
	@ResponseBody
	public Object queryCardManager(HttpServletRequest request) {
		try{
			PageData pd = new PageData(request);
			JSONObject responseData= passCardManagerService.queryCard(pd);
			logger.info("通证卡片请求返回数据："+responseData.get("list"));
			return responseData.get("list");
		}catch(Exception e){
			e.printStackTrace();
		}
		return null;
	}

 }
